package com.xb.cloud.common.util;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

//import com.yihaodian.architecture.hedwig.common.uuid.UUID;

public class UUidUtils {

	/**
	 * 获得一个去掉"-"符号的UUID
	 * 
	 * @return
	 */
	public static String getUUID() {
		String s = UUID.randomUUID().toString();
		return s.replace("-", "");
	}

	/**
	 * 获得指定数目的UUID
	 * 
	 * @param number
	 *            int 需要获得的UUID数量
	 * @return String[] UUID数组
	 */
	public static String[] getUUID(int number) {
		if (number < 1) {
			return null;
		}
		String[] ss = new String[number];
		for (int i = 0; i < number; i++) {
			ss[i] = getUUID();
		}
		return ss;
	}

	public static String generateProductCode(Long productId) {
		return "PC" + String.format("%012d", productId) + Long.toHexString((productId % 32)).toUpperCase();
	}
}
